home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / exsyslib / include / hardware / exsys_takeover.s < prev   
Text File  |  1980-01-03  |  1KB  |  39 lines

  1. *****************************************************************************
  2. * 'exsys.library' Startup Interface glue routines..
  3. * ---------------------------------------------------------------------------
  4. * This code opens the 'exsys.library' and executes your demo/game code. 
  5. * After your demo game has finished it automatically closes itself and returns
  6. * to the OS...
  7. *
  8. * The below defined structure is returned by in a4 at the label '_main' and
  9. * you may read the values from this for your own use. See examples where
  10. * for instance the '_OSVBR' (OS vectorbase register) is used, etc.
  11. ******************************************************************************
  12.         rsreset
  13. _ID:        rs.l    1        ;id of structure..
  14. _OSDmacon    rs.w    1        ;dmacon
  15. _OSIntreq    rs.w    1        ;intreq
  16. _OSIntena    rs.w    1        ;intena
  17. _OSAdkcon    rs.w    1        ;adkcon
  18. _OSVBR:        rs.l    1        ;vector base (VBR)
  19. _OSCopper1:    rs.l    1        ;wb copperlist 1
  20. _OSCopper2:    rs.l    1        ;wb copperlist 2
  21. _OSOldview:    rs.l    1        ;os oldview
  22. _GfxBase    rs.l    1        ;graphics base
  23. _OSVecs:    rs.l    62        ;copy of vectorbase
  24.         rsreset
  25.  
  26. ProgStart:    move.l    4.w,a6
  27.         lea    exsysname(pc),a1
  28.           jsr    -408(a6)        ; open exsys.library...
  29.         tst.l    d0            ; did it open?
  30.           beq.s    open_error
  31.           move.l    d0,a6
  32.         lea    _main(pc),a0
  33.         jmp    -30(a6)            ; Shutdown OS & call our code
  34. open_error:    moveq    #-1,d0            ; cannot open library...
  35.         rts
  36. exsysname:    dc.b    'exsys.library',0    ; name of our library..
  37.         even
  38. _main:
  39.